package pl.factat.gfk;

/**
 * Created with IntelliJ IDEA.
 * User: adam
 * Date: 08.01.13
 * Time: 19:01
 * ARGB point wrapper. Contains the usual red, green, blue plus additionally alpha values.
 */
public class RGBPoint {
    public int r;
    public int g;
    public int b;
    public int a;

    public static RGBPoint getPointFromInt(int rgb) {
        RGBPoint tmp = new RGBPoint();
        tmp.a = (rgb >> 24) & 0xff;
        tmp.r = (rgb >> 16) & 0xff;
        tmp.g = (rgb >> 8) & 0xff;
        tmp.b = rgb & 0xff;
        return tmp;
    }

    public static int getIntFromPoint(RGBPoint rgb) {
        return (rgb.a << 24) | (rgb.r << 16) | (rgb.g << 8) | rgb.b;
    }
}
